<template>
	<view :style="themeColor">
		<view class="page">
			<view class="flex flex-wrap align-center justify-between benben-position-layout flex addMasterWorker_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center addMasterWorker_fd0_0' @tap.stop="handleJumpDiy"
					data-type="back" data-url="1">
					<image class='addMasterWorker_fd0_0_c0' mode="aspectFit" :src='STATIC_URL+"94.png"'></image>
				</view>
				<text class='addMasterWorker_fd0_1'>师傅信息</text>
				<view class='flex flex-wrap align-center addMasterWorker_fd0_0'>
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view
				class="flex flex-direction flex-wrap align-center justify-center benben-flex-layout addMasterWorker_flex_1"
				v-if="masterWorkerData.status=='3'">
				<text class='addMasterWorker_fd1_0'>审核失败，提供的信息有误</text>
				<view>
					<text class='addMasterWorker_fd1_1_c0'>失败原因：</text>
					<text class='addMasterWorker_fd1_1_c0'>{{masterWorkerData.reason}}</text>
				</view>
			</view>

			<!---flex布局flex布局结束-->
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction align-stretch benben-flex-layout addMasterWorker_flex_2">
				<view class='flex align-center justify-between addMasterWorker_fd2_0'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_0_c0_c1'>头像</text>
					</view>
					<image class='addMasterWorker_fd2_0_c1' mode="aspectFit" :src='masterWorkerData.avatar'></image>
				</view>
				<view class='flex align-center justify-between addMasterWorker_fd2_0'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_0_c0_c1'>姓名</text>
					</view>
					<benben-input class='flex-sub addMasterWorker_fd2_1_c1' type="text" :placeholder="`请输入姓名`"
						confirm-type="done" :maxlength="-1" :disabled='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx"
						v-model="masterWorkerData.name" />
				</view>
				<view class='flex align-center justify-between addMasterWorker_fd2_0'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_0_c0_c1'>性别</text>
					</view>
					<benben-input class='flex-sub addMasterWorker_fd2_2_c1' type="text" :placeholder="`请选择`"
						confirm-type="done" :maxlength="-1" :disabled='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx" v-model="sexLable" />
					<!-- <text class='fu-iconfont2  addMasterWorker_fd2_2_c2'>&#xe7f2;</text> -->
				</view>
				<view class='flex align-center justify-between addMasterWorker_fd2_0'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_0_c0_c1'>联系方式</text>
					</view>
					<benben-input class='flex-sub addMasterWorker_fd2_1_c1' type="number" :placeholder="`请输入手机号`"
						confirm-type="done" :maxlength="11" :disabled='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx"
						v-model="masterWorkerData.phone" />
				</view>
				<view class='flex align-center justify-between addMasterWorker_fd2_0'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_4_c0_c1'>服务分类</text>
					</view>
					<benben-input class='flex-sub addMasterWorker_fd2_2_c1' type="text" :placeholder="`请选择`"
						confirm-type="done" :maxlength="-1" :disabled='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx"
						v-model="masterWorkerData.category_name" />
					<!-- <text class='fu-iconfont2  addMasterWorker_fd2_2_c2'>&#xe7f2;</text> -->
				</view>
				<view class='flex align-center justify-between addMasterWorker_fd2_0'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_4_c0_c1'>选择所在地</text>
					</view>
					<benben-input class='flex-sub addMasterWorker_fd2_2_c1' type="text" :placeholder="`请选择`"
						confirm-type="done" :maxlength="-1" :disabled='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx"
						v-model="masterWorkerData.address" />
					<!-- <text class='fu-iconfont2  addMasterWorker_fd2_2_c2'>&#xe7f2;</text> -->
				</view>
				<view class='flex align-center justify-between addMasterWorker_fd2_0'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_0_c0_c1'>身份证号</text>
					</view>
					<benben-input class='flex-sub addMasterWorker_fd2_1_c1' type="idcard" :placeholder="`请输入身份证号`"
						confirm-type="done" :maxlength="18" :disabled='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:32rpx"
						v-model="masterWorkerData.idcard_no" />
				</view>
				<view class='flex align-center justify-between addMasterWorker_fd2_7'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_0_c0_c1'>身份证正面</text>
					</view>
					<view class="upload position-relative">
						<image class=" addMasterWorker_fd2_7_c1_image" mode="aspectFill"
							:src="masterWorkerData.idcard_emblem">
						</image>
					</view>
				</view>
				<view class='flex align-center justify-between addMasterWorker_fd2_7'>
					<view class='flex flex-wrap align-center'>
						<!-- <text class='addMasterWorker_fd2_0_c0_c0'>*</text> -->
						<text class='addMasterWorker_fd2_0_c0_c1'>身份证反面</text>
					</view>
					<view class="upload position-relative">

						<image class=" addMasterWorker_fd2_7_c1_image" mode="aspectFill"
							:src="masterWorkerData.idcard_portrait">
						</image>
					</view>
				</view>
				<!-- 	<view class='flex align-center justify-between addMasterWorker_fd2_9'>
					<view class='flex flex-wrap align-center'>
						<text class='addMasterWorker_fd2_0_c0_c0'>*</text>
						<text class='addMasterWorker_fd2_0_c0_c1'>资格证书</text>
					</view>
					<view class="upload position-relative">
						<image class=" addMasterWorker_fd2_7_c1_image" mode="aspectFill"
							@tap="soloChooseImage('credentials','credentials',masterWorkerData,masterWorkerData)"
							:src="masterWorkerData.credentials ? masterWorkerData.credentials : STATIC_URL+'97.png'">
						</image>
					</view>
				</view> -->
			</view>

			<!---flex布局flex布局结束-->


		</view>
	</view>
</template>
<script>
	import UploadImage from '@/common/utils/upload-image.js'
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		components: {},


		data() {
			return {
				"sexLable": "",
				"masterWorkerData": {
					"aid": "",
					"idcard_no": "",
					"name": "",
					"idcard_emblem": "",
					"idcard_portrait": "",
					"idcard_time": "",
					"reason": "",
					"status": "",
					"phone": "",
					"skill": "",
					"sex": "",
					"address": "",
					"credentials": "",
					"avatar": "",
					"type_name": "",
					"mature_time": "",
					"aptitude_start_time": "",
					"certificatetype_id": "",
					"fid": "",
					"hand_card": "",
					"standby_phone": "",
					"detail_address": "",
					"service_area": "",
					"category_name": "",
					"chinaarea_id": "",
					"remark": "",
					"practise_time": ""
				},
				"shopID": "",
				"id": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},
			/**
			 * @returns 
			 * Android       安卓
			 * IOS       苹果
			 * Web       H5 或 pc
			 * Wechat       微信小程序
			 * Alipay       支付宝小程序
			 * Baidu       百度小程序
			 * ByteBounce       抖音小程序
			 * 360       360小程序
			 * FastApp       快应用
			 */
			appSystemIdentification() {
				return this.$store.state.appSystemIdentification
			}
		},
		watch: {},
		onLoad(options) {
			let {
				id,
				shopID
			} = options
			if (id !== undefined) this.id = id
			if (shopID !== undefined) this.shopID = shopID
			this.getMasterWorkerFunc()
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {
			this.shopID = uni.getStorageSync('shopID') || ''
		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//上传单图、多图方法
			soloChooseImage(id, path, obj, obj1, fnName = false) {
				if (!this.setCheckPermission(2)) {
					return
				}
				let self = this
				if (!obj) obj = this
				if (!obj1) obj1 = this
				if (self.uploading) {
					return
				}
				// 从相册中选择图片
				uni.chooseImage({
					count: 1, // 默认3
					sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
					success: function(res) {
						self.uploading = true
						// 开始上传
						new UploadImage(res.tempFiles, {
							complete: function(res) {
								self.uploading = false
								if (id) self.$set(obj, id, res[0].id)
								if (path) self.$set(obj1, path, res[0].path)
								if (fnName) self[fnName]()
							},
						})
					},
				})
			},
			//获取师傅信息
			async getMasterWorkerFunc() {
				//请求方法
				//数据验证

				let datamasterWorkerData = await this.$api.get(global.apiUrls.post637c7e1d7d61e, {
					aid: this.id
				});

				if (datamasterWorkerData.data.code != 1) {
					this.$message.info(datamasterWorkerData.data.msg);
					return
				}
				let infomasterWorkerData = datamasterWorkerData.data;
				this.masterWorkerData = infomasterWorkerData.data

				if (this.masterWorkerData.sex == '0') {
					this.sexLable = '保密';
					return
				} else if (this.masterWorkerData.sex == '1') {
					this.sexLable = '男';
					return
				} else if (this.masterWorkerData.sex == '2') {
					this.sexLable = '女';
					return
				}
			}
		}
	};
</script>
<style lang="scss" scoped>
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto;
	}

	.addMasterWorker_flex_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.addMasterWorker_fd0_1 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 500;
		line-height: 50rpx;
	}

	.addMasterWorker_fd0_0_c0 {
		width: 20rpx;
		height: 36rpx;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.addMasterWorker_fd0_0 {
		width: 100rpx;
		height: 88rpx;
	}

	.addMasterWorker_flex_1 {
		background: rgba(248, 209, 208, 1);
		background-size: 100% auto !important;
		padding: 24rpx 32rpx 24rpx 32rpx;
	}

	.addMasterWorker_fd1_1_c0 {
		font-size: 28rpx;
		font-weight: 400;
		color: rgba(227, 29, 26, 1);
		line-height: 33rpx;
	}

	.addMasterWorker_fd1_0 {
		font-size: 28rpx;
		font-weight: 400;
		color: rgba(227, 29, 26, 1);
		line-height: 33rpx;
		margin: 0rpx 0rpx 16rpx 0rpx;
	}

	.addMasterWorker_flex_2 {
		padding: 0rpx 24rpx 0rpx 24rpx;
	}

	.addMasterWorker_fd2_9 {
		background: #fff;
		background-size: 100% auto !important;
		padding: 32rpx 0rpx 32rpx 0rpx;
		font-size: 28rpx;
	}

	.addMasterWorker_fd2_7_c1_image {
		width: 320rpx;
		height: 180rpx;
		border-radius: 16rpx 16rpx 16rpx 16rpx;
	}

	.addMasterWorker_fd2_7 {
		border-bottom: 1px solid rgba(238, 238, 238, 1);
		background: #fff;
		background-size: 100% auto !important;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.addMasterWorker_fd2_4_c0_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		line-height: 40rpx;
		margin: 0rpx auto 0rpx 0rpx;
	}

	.addMasterWorker_fd2_2_c2 {
		font-size: 24rpx;
		color: rgba(191, 191, 191, 1);
		margin: 0rpx 0rpx 6rpx 16rpx;
	}

	.addMasterWorker_fd2_2_c1 {
		text-align: right;
		margin: 0rpx 0rpx 0rpx 24rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
	}

	.addMasterWorker_fd2_1_c1 {
		text-align: right;
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
		margin: 0rpx 0rpx 0rpx 32rpx;
	}

	.addMasterWorker_fd2_0_c1 {
		width: 88rpx;
		height: 88rpx;
		border-radius: 44rpx;
	}

	.addMasterWorker_fd2_0_c0_c1 {
		color: #333333;
		font-size: 32rpx;
		font-weight: 400;
		line-height: 40rpx;
	}

	.addMasterWorker_fd2_0_c0_c0 {
		color: rgba(255, 0, 0, 1);
	}

	.addMasterWorker_fd2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 32rpx 0rpx 32rpx 0rpx;
		background-size: 100% auto !important;
	}
</style>